<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="../../../../../WEB-INF/myTag.tld" prefix="my"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>出租房管理</title>
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/animate.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
	
</head>

<body class="gray-bg">
    <!-- 分页 -->
	<form id="pagerForm" method="post" action="listHouse.do">
		<input type="hidden" name="currentPage" id="currentPage" value="1" />
		<input type="hidden" name="address" value="${dataStore.address}" />
		<input type="hidden" name="status" value="${dataStore.status}" />
		<input type="hidden" name="start" value="${dataStore.start}" />
		<input type="hidden" name="end" value="${dataStore.end}" />
	</form>
    
    <div class="wrapper wrapper-content animated fadeInRight">
    	<div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>出租房管理</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                    
                    	<!-- 搜索区 -->
                    	<div class="m-b-sm">
                    	<form id="newsList" name="newsList" action="listHouse.do" method="post">
                    	<div class="m-b-sm">
                    	
                    	<div class="col-lg-2">
                    		<div class="input-group">
                    			<span class="input-group-addon">地址:</span>
								<input type="text" class="form-control" name="address" value="${dataStore.address}"/>
							</div>
						</div>
						<div class="col-lg-2">
                    		<div class="input-group">
                    			<span class="input-group-addon">房东姓名:</span>
								<input type="text" class="form-control" name="hostName" value="${dataStore.hostName}"/>
							</div>
						</div>
						
						<div class="col-lg-2">
							<div class="input-group">
							<span class="input-group-addon">审核状态:</span>
							<select name="status" class="form-control">
								<option value="">所有状态</option>
								<option value="1" <c:if test="${dataStore.status == '1'}">selected="selected"</c:if> >待审核</option>
								<option value="2" <c:if test="${dataStore.status == '2'}">selected="selected"</c:if> >审核通过</option>
								<option value="3" <c:if test="${dataStore.status == '3'}">selected="selected"</c:if> >审核拒绝</option>
							</select>
							</div>
						</div>
						
						<div class="col-lg-2">
                    		<div class="input-group">
                    			<span class="input-group-addon">身份证号:</span>
								<input type="text" class="form-control" name="hostIdCard" value="${dataStore.hostIdCard}"/>
							</div>
						</div>
							
						<div class="col-md-3" id="data_5">
                            <div class="input-daterange input-group" id="datepicker">
                            	<span class="input-group-addon input-title">采集时间:</span>
                                <input type="text" class="form-control" name="start" value="${dataStore.start}" />
                                <span class="input-group-addon">至</span>
                                <input type="text" class="form-control" name="end" value="${dataStore.end}" />
                            </div>
                        </div>
                    	</div>
                    	<div class="col-lg-2">
							<div class="input-group">
							<span class="input-group-addon">分县局:</span>
							<select name="fxj" class="form-control">
									<c:forEach items="${depas}" var="item">
                              			<option value="${item.depaCode}">${item.depaName}</option>
                              		</c:forEach>
							</select>
							</div>
						</div>
                    	
                    	
                    	<button type="submit" id="search" class="btn btn-info" ><i class="fa fa-search"></i>&nbsp;&nbsp;搜索</button>
                    	</form>
                    	</div>
                    	
                    	<!-- <div class="m-b-sm">
                    		<button type="button" class="btn btn-success btn-sm" onclick="add();"><i class="fa fa-plus-circle"></i>&nbsp;&nbsp;添加</button>
                    	</div> -->

						<!-- 列表区 -->
						<div class="m-b-sm">
							<table id="table" data-toggle="table" data-striped="true" >
								<thead>
									<tr>
										<th data-checkbox="true" data-width="2%"></th>
										<th data-visible="false">id</th>
										<th data-width="3%" data-align="center">序号</th>
										<th data-width="20%">出租房地址</th>
										<th data-width="8%">房东姓名</th>
										<th data-width="10%">身份证号</th>
										<th data-width="10%">联系电话</th>
										<th data-width="12%">户籍地址</th>
										<th data-width="6%">分县局</th> 
										<th data-width="6%">派出所</th>
										<th data-width="7%">审核状态</th>
										<th data-width="8%">采集时间</th>
										<th data-width="10%" data-align="center">操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${pageInfo.resultList}" var="item" varStatus="i">
										<tr>
											<td></td>
											<td>${item.fwid}</td>
											<td>${i.index + 1}</td>
											<td>${item.fwxz}</td>
											<td>${item.fzxm}</td>
											<td>${item.fzsfz}</td>
											<td>${item.fzsj}</td>
											<td>${item.hjszd}</td>
											<td>${item.fj}</td>
											<td>${item.pcs}</td>
											<td>
											<c:choose>
												<c:when test="${item.shzt == 1}">待审核</c:when>
												<c:when test="${item.shzt == 2}">审核通过</c:when>
												<c:when test="${item.shzt == 3}">审核拒绝</c:when>
												<c:otherwise>未知类型</c:otherwise>
											</c:choose>
											</td>
											<td><my:DateSubString date="${item.djsj}" subNum="16"/></td>
											<td>
												<button type="button" class="btn btn-primary btn-xs" onclick="detail('${item.fwid}');">详情</button>
												<button type="button" class="btn btn-success btn-xs" onclick="edit('${item.fwid}');">编辑</button>
												<c:if test="${item.shzt=='1'}">
													<button type="button" class="btn btn-success btn-xs" onclick="auditing('${item.fwid}');">审核</button>
												</c:if>
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>

						<jsp:include page="../../../common/turnPage.jsp" />
					</div>
                </div>
            </div>
            
        </div>

		<!-- <div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						
					</div>
				</div>
			</div>
		</div> -->

	</div>
    
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/content.min.js?v=1.0.0"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/toastr/toastr.min.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/layer/layer.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    
    <script type="text/javascript">
    
    var basePath = '<%=request.getContextPath()%>';
    
    toastr.options = {
  		  "closeButton": true,
  		  "debug": false,
  		  "progressBar": true,
  		  "positionClass": "toast-top-left",
  		  "showDuration": "400",
  		  "hideDuration": "1000",
  		  "timeOut": "3000",
  		  "extendedTimeOut": "1000",
  		  "showEasing": "swing",
  		  "hideEasing": "linear",
  		  "showMethod": "fadeIn",
  		  "hideMethod": "fadeOut"
  		}
    
    //初始化日期控件
    $("#data_5 .input-daterange").datepicker({
        keyboardNavigation: !1,
        forceParse: !1,
        autoclose: !0
    });
    
    function edit(houseid){
    	debugger;
    	layer.open({
    		  type: 2,
    		  title: '出租房审核',
    		  shadeClose: true,
    		  shade: 0.3,
    		  area: ['800px', '480px'],
    		  content: basePath + '/bgCzf/editHouse.do?houseid='+houseid
    		  //iframe的url
    		});
    }
    function detail(houseid){
    	debugger;
    	layer.open({
    		  type: 2,
    		  title: '出租房信息详细',
    		  shadeClose: true,
    		  shade: 0.3,
    		  area: ['800px', '480px'],
    		  content: basePath + '/bgCzf/houseDetail.do?houseid='+houseid
    		  //iframe的url
    		});
    }
    
    function auditing(houseid){
    	debugger;
    	layer.open({
    		  type: 2,
    		  title: '出租房信息审核',
    		  shadeClose: true,
    		  shade: 0.3,
    		  area: ['800px', '480px'],
    		  content: basePath + '/bgCzf/auditingHouse.do?houseid='+houseid
    		  //iframe的url
    		});
    }
    
    
    </script>
    
</body>

</html>